<?php
/**
 * Created by PhpStorm.
 * User: liandne
 * Date: 2016/12/12
 * Time: 下午5:08
 */

namespace App\Http\Requests;


class BespokeRequest extends Request
{
    /**
     * Determine if the user is authorized to make this request.
     *
     * @return bool
     */
    public function authorize()
    {
        return true;
    }

    public function attributes()
    {
        return [
            'unit_login' => '统一登录',
            'username'   => '用户名',
            'email'      => '邮箱',
            'phone'      => '手机号',
            'password'   => '密码',
            'remember'   => '记住密码',
        ];
    }

    /**
     * Get the validation rules that apply to the request.
     *
     * @return array
     */
    public function rules()
    {
        return [
//            'name'          => 'required_without_all:unit_login,email,phone|alpha_dash|min:2|max:20',
            'born'          => 'required|string',
            'phone'         => ['required_without_all:unit_login,username,email', 'regex:/1\d{10}/'],
            'time'          => 'required|string',
            'pack_id'       => 'integer|min:0',
            'doc_id'        => 'integer|min:0',
            'slot'          => 'integer|min:0',
        ];
    }
}